Skip to content

Make filter Context nullability explicit - #2208

Merged
pedroSG94 merged 1 commit into
pedroSG94:masterfrom
blihio:fix/crop-filter-context-nullability
Oct 8, 2026
Merged

pedroSG94 merged 1 commit into
pedroSG94:masterfrom
blihio:fix/crop-filter-context-nullability

Conversation

@blihio

@blihio blihio commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

CropFilterRender accepted a nullable Kotlin Context while passing it to Java code that dereferences the context as non-null. This change makes the nullability contract explicit across the filter initialization path while preserving existing behavior for valid calls.

Changes

  • Add @NonNull to the Java filter initialization parameters.
  • Add @NonNull to GlUtil.getStringFromRaw.
  • Change CropFilterRender.initGlFilter from Context? to Context.
  • Change MainRender.context to a non-null lateinit property.
  • Add a regression test covering non-null context forwarding.

Validation

.\gradlew.bat :encoder:testDebugUnitTest

The build completed successfully:
BUILD SUCCESSFUL

The regression test BaseFilterRenderTest.initGlForwardsContextToFilter passed.
Related to #2207

@blihio

blihio commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

The Android CI workflow is awaiting maintainer approval.
Could a maintainer please approve the workflow run for this pull request?

@pedroSG94
pedroSG94 merged commit 241f539 into pedroSG94:master Oct 8, 2026
1 check passed
@pedroSG94

Copy link
Copy Markdown
Owner

Thank you for the PR. Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants